# list=['zhm','xr','lyf','fbb','lbb']
#
# for i in range(len(list)):
#     print(f'{i}: {list[i]}')
#
# for i,t in enumerate(list):
#     print(f'{i}: {t}')
import random
names = ['关羽', '张飞', '赵云', '马超', '黄忠']
courses = ['语文', '数学', '英语']

scores=[[0]*len(courses) for _ in range(len(names))]

for i,name in enumerate(names):
    print(f'{name},成绩如下：')
    for j ,score in enumerate(courses):
        scores[i][j]=random.randint(50,100)
        print(f'{courses[j]}：{scores[i][j]}',end='\t')
    print()

for i,name in enumerate(names):
    ave=sum(scores[i])/len(courses)
    print(f'{name}的课程平均分：{ave:.2f}')

for i,course in enumerate(courses):
    currentCourseScores=[score[i] for score in scores]
    aveCourse=sum(currentCourseScores)/len(names)
    print(f'{course}的平均成绩：{aveCourse:.2f}')